﻿Option Explicit On
Option Strict On

''' <summary>
''' Esta Clase dibuja la clase cita para recoger los datos y se guardar el dato cita para luego 
''' recuperarla
''' </summary>
''' <remarks>Francisco Juan Royo Bua -> 23/01/2012 </remarks>
Public Class ObjDarCita

#Region "atributos"

    Private _PanelDarCita As Panel
    Private _LabelNombreCliente As Label
    Private _LabelEmpleado As Label
    Private _LabelFecha As Label
    Private _LabelHora As Label
    Private _LabelTratamiento As Label
    Private _ComboBoxCliente As ComboBox
    Private _ComboBoxEmpleado As ComboBox
    Private _ComboBoxHora As ComboBox
    Private _ComboBoxMinuto As ComboBox
    Private _ComboBoxSemana As ComboBox
    Private _ComboBoxFecha As DateTimePicker
    Private _ComboBoxTratamiento As ComboBox 'este tiene las prpiedades para guardar en el listacombobox
    Private _ListaComboBoxTratamiento As List(Of ComboBox) ' este se muestra
    Private _BotonIncrementaCombox As Button
    Private _BotonDesminuirCombox As Button
    Private _BotonConfirmar As Button
    Private _BotonLimpiar As Button


    'atributos de dimension y colocacion
    Private _X As Integer
    Private _Y As Integer
    Private _Alto As Integer
    Private _Ancho As Integer
    Private _TamanyoLetra As Integer
    Private _Visible As Boolean

#End Region


#Region "Constructor"

    Public Sub New(ByVal control As Control)

        Me.DarValorAtributos()
        Me.CrearPanel(control)
        Me.CrearLabel(_PanelDarCita)
        Me.CrearComboBox(_PanelDarCita)

    End Sub

#End Region


#Region "get y set"

    Public Property Visible As Boolean
        Get
            Return _Visible
        End Get
        Set(ByVal value As Boolean)
            _Visible = value
            _PanelDarCita.Visible = _Visible
        End Set
    End Property

#End Region


#Region "Metodos publicos"

#End Region


#Region "Metodos privados"

    ''' <summary>
    ''' Esto guardar todos los controles
    ''' </summary>
    ''' <param name="control">Tienes que pasar un control</param>
    ''' <remarks></remarks>
    Private Sub CrearPanel(ByVal control As Control)
        _PanelDarCita = New Panel
        With _PanelDarCita
            .Name = "PanelDarCita"
            .Width = _Ancho
            .Height = _Alto
            .Location = New Point(_X, _Y)
            .Visible = _Visible
            .AutoScroll = True
            .AutoSize = False
            .Visible = _Visible
        End With

        control.Controls.Add(_PanelDarCita)
    End Sub



    Private Sub CrearLabel(ByVal control As Control)

        Dim XLabel As Integer = 20
        Dim YLabel As Integer = 20
        Dim IncremetoFijo As Integer = 10
        Dim IncremetoY As Integer = 0

        _LabelNombreCliente = New Label
        With _LabelNombreCliente
            .Name = "LabelNombreCliente"
            .Text = "Cliente:"
            .Font = New System.Drawing.Font("Microsoft Sans Serif", _TamanyoLetra, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
            .Location = New Point(XLabel, YLabel)
            .AutoSize = True
        End With

        IncremetoY = IncremetoFijo + _LabelNombreCliente.Height

        _LabelEmpleado = New Label
        With _LabelEmpleado
            .Name = "LabelEmpleado"
            .Text = "Empleado:"
            .Font = New System.Drawing.Font("Microsoft Sans Serif", _TamanyoLetra, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
            .Location = New Point(XLabel, YLabel + IncremetoY)
            .AutoSize = True
        End With

        IncremetoY = IncremetoFijo * 2 + _LabelNombreCliente.Height * 2

        _LabelFecha = New Label
        With _LabelFecha
            .Name = "LabelFecha"
            .Text = "Fecha:"
            .Font = New System.Drawing.Font("Microsoft Sans Serif", _TamanyoLetra, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
            .Location = New Point(XLabel, YLabel + IncremetoY)
            .AutoSize = True
        End With

        IncremetoY = IncremetoFijo * 3 + _LabelNombreCliente.Height * 3

        _LabelHora = New Label
        With _LabelHora
            .Name = "LabelHora"
            .Text = "Hora:"
            .Font = New System.Drawing.Font("Microsoft Sans Serif", _TamanyoLetra, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
            .Location = New Point(XLabel, YLabel + IncremetoY)
            .AutoSize = True
        End With

        IncremetoY = IncremetoFijo * 4 + _LabelNombreCliente.Height * 4

        _LabelTratamiento = New Label
        With _LabelTratamiento
            .Name = "LabelTratamiento"
            .Text = "Tratamientos:"
            .Font = New System.Drawing.Font("Microsoft Sans Serif", _TamanyoLetra, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
            .Location = New Point(XLabel, YLabel + IncremetoY)
            .AutoSize = True
        End With

        control.Controls.Add(_LabelEmpleado)
        control.Controls.Add(_LabelNombreCliente)
        control.Controls.Add(_LabelHora)
        control.Controls.Add(_LabelFecha)
        control.Controls.Add(_LabelTratamiento)

    End Sub
   
    ''' <summary>
    ''' Creamos los combobox y el data timer
    ''' </summary>
    ''' <param name="control">Tienes que pasar un control</param>
    ''' <remarks></remarks>
    Private Sub CrearComboBox(ByVal control As Control)

        Dim anchoComboBox As Integer = 300
        Dim separacionVertical As Integer = 20

        _ComboBoxCliente = New ComboBox
        With _ComboBoxCliente

            .Name = "ComboBoxCliente"
            .Text = "CLIENTE"
            .Width = anchoComboBox
            .Height = _LabelNombreCliente.Height
            .Location = New Point(_LabelNombreCliente.Location.X + _LabelNombreCliente.Width + separacionVertical, _LabelNombreCliente.Location.Y)

        End With
        control.Controls.Add(_ComboBoxCliente)

        _ComboBoxEmpleado = New ComboBox
        With _ComboBoxEmpleado

            .Name = "ComboBoxEmpleado"
            .Text = "EMPLEADO"
            .Width = anchoComboBox
            .Height = _LabelEmpleado.Height
            .Location = New Point(_LabelEmpleado.Location.X + _LabelEmpleado.Width + separacionVertical, _LabelEmpleado.Location.Y)

        End With
        control.Controls.Add(_ComboBoxEmpleado)

        _ComboBoxFecha = New DateTimePicker
        With _ComboBoxFecha

            .Name = "ComboBoxFecha"
            .Width = anchoComboBox
            .Height = _LabelFecha.Height
            .Location = New Point(_LabelFecha.Location.X + _LabelFecha.Width + separacionVertical, _LabelFecha.Location.Y)

        End With
        control.Controls.Add(_ComboBoxFecha)

        _ComboBoxHora = New ComboBox
        With _ComboBoxHora

            .Name = "ComboBoxHora"
            .Text = "HORA"
            .Width = anchoComboBox
            .Height = _LabelHora.Height
            .Location = New Point(_LabelHora.Location.X + _LabelHora.Width + separacionVertical, _LabelHora.Location.Y)

        End With
        control.Controls.Add(_ComboBoxHora)

    End Sub

    Private Sub CrearBotones(ByVal control As Control)

    End Sub

    Private Sub DarValorAtributos()
        _Alto = 600
        _Ancho = 600
        _X = 0
        _Y = 0
        _TamanyoLetra = 12
        _Visible = True
    End Sub

    Private Sub DarValorAtributos(ByVal X As Integer, ByVal Y As Integer, ByVal Ancho As Integer, ByVal Alto As Integer, ByVal TamanyoLetra As Integer, ByVal Visible As Boolean)
        _Alto = Alto
        _Ancho = Ancho
        _X = X
        _Y = Y
        _TamanyoLetra = TamanyoLetra
        _Visible = Visible
    End Sub

#End Region

End Class
